package file_io;

import java.io.*;

public class ObjectStream {
    public static void main(String[] args) throws Exception {
//        FileOutputStream fos = new FileOutputStream("src/test.txt",true);
//        ObjectOutputStream oos = new ObjectOutputStream(fos);
//
//        oos.writeObject(new Men("zcg", 22, 100));
//        oos.close();
        readObject();

    }
    static void readObject() throws IOException, ClassNotFoundException {
        FileInputStream fis = new FileInputStream("src/test.txt");
        new InputStreamReader(new FileInputStream(""));
        ObjectInputStream ois = new ObjectInputStream(fis);
        Men o = (Men) ois.readObject();
//        Men o1 = (Men) ois.readObject();
//        System.out.println(o1);
        System.out.println(o);
        ois.close();
    }
}
